In combinatorics, the Eulerian Number A(n, m), is the number of permutations of the numbers 1 to n in which exactly m elements are greater than previous element....
Given a n x n matrix of integers. The problem is to find the largest area rectangular sub-matrix having sum divisible by the given value k....
Given two integers N and K, the task is to find the number of different arrays of size N that can be formed having the first element as K such that every element except last, is divisible by the next element in the array. Since the count can be very large, so print the modulo 109 + 7....
Given three integers N, M and K. The task is to find the number of ways to fill N positions using M colors such that there are exactly K pairs of different adjacent colors....
Given an array arr[] having N integers, the task is to find the next greater number X i.e, X >= arr[i] for each i in the range [0, N) such that the count of unique digits in X is exactly 2....
Given three integers M, N and K, the task is to count all the possible paths from the cell (0, 0, 0) to cell (M-1, N-1, K-1) in a matrix of size (M, N, K). Movement is allowed only in three directions, which are along the positive direction of the three axes i.e. from any cell (i, j, k) movement is allowed to cells (i+1, j, k), (i, j+1, k) and (i, j, k+1)....
Given three integers X, Y and P, the task is to find the minimum window size K such that every window in the range [X, Y] of this size have atleast P prime numbers.Examples:...
Given a positive integer N, the task is to count the number of N-digit numbers which contain all single digit primes....
Given three integers N, P and K, the task is to find the number of ways of painting K cells of 3 x N grid such that no adjacent cells are painted and also no continuous P columns are left unpainted. Note: Diagonal cells are not considered as adjacent cells. Examples:...
Given an Integer N, and a number K, the task is to find out the total numbers from 0 to N which have exactly K non zero digits and the sum of those digits should be odd and that sum should be distinct. The number N can be as large as 10^18.Examples:...
Given an integer N, the task is to count the number of subsets formed from an array of integers from 1 to N which doesn’t contain adjacent elements. A subset can’t be chosen if it satisfies the non-adjacent element condition, but it is possible to add more elements.Examples:...